<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.2.1.min.js"></script>
    <link rel="stylesheet">
    <script>
        $(function () {
            $("#selectButton").click(function () {
                $("#imgDiv").show("fast");
            });
            // $("#imgDiv img")
            $("#imgDiv").find("img").click(function () {
                // alert(this.src);
                // alert($(this).attr("src"));
                $("#faceImg").prop("src",this.src);
                $("#imgDiv").hide("fast");
            });

            // alert($("#imgDiv  img")[0].src)
        });
    </script>
</head>
<body>
    <img src="photo/b1.jpg" id="faceImg"><br>
    <input type="button" value="选择头像" id="selectButton"><br>
    <div id="imgDiv" style="display: none">
        <img src="photo/b1.jpg" >
        <img src="photo/b2.jpg" >
        <img src="photo/b3.jpg" >
        <img src="photo/b4.jpg" >
        <img src="photo/b5.jpg" >
    </div>

</body>
</html>